import request from '@/utils/request'

// 创建店铺
export function createShop(data) {
  return request({
    url: '/lfd/shop/create',
    method: 'post',
    data: data
  })
}

// 更新店铺
export function updateShop(data) {
  return request({
    url: '/lfd/shop/update',
    method: 'put',
    data: data
  })
}

// 删除店铺
export function deleteShop(id) {
  return request({
    url: '/lfd/shop/delete?id=' + id,
    method: 'delete'
  })
}

// 获得店铺
export function getShop(id) {
  return request({
    url: '/lfd/shop/get?id=' + id,
    method: 'get'
  })
}

export function getAllShop() {
  return request({
    url: '/lfd/shop/mini-list',
    method: 'get'
  })
}

// 获得店铺分页
export function getShopPage(query) {
  return request({
    url: '/lfd/shop/page',
    method: 'get',
    params: query
  })
}

// 导出店铺 Excel
export function exportShopExcel(query) {
  return request({
    url: '/lfd/shop/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
